Skip to content

test(github-backup): stubbed drain-wrapper.sh credential-branch test + fail loudly with no credential (#5222) - #6542

Merged
dezren39 merged 1 commit into
mainfrom
queue/8957-5222-drain-wrapper-test
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/8957-5222-drain-wrapper-test

Conversation

@dezren39

@dezren39 dezren39 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Closes #5222.

  • Adds infra/github-backup/tests/test_drain_wrapper.py (picked up by the existing github-backup-tests.yml glob): drives a copy of drain-wrapper.sh with a fake HOME, stub bws and stub drain target — no Bitwarden, no network. Covers: (1) BWS_ACCESS_TOKEN pre-set, (2) token file + bare bws ok, (3) bare bws fails → bws-env.sh sourced from each candidate path, (4) no credential path.
  • The new test showed branch 4 broken: with no credential, bws secret list fails, the python helper dies on a KeyError, but eval "$(…)" of its empty stdout succeeds, so the wrapper exec'd the drain with no credentials. Fix: re-probe after the fallback and exit 1 with a message naming the credential problem. Other branches unchanged.

Oracle: the stub drain target records the credentials/token it received; the wrapper's exit code and stderr are asserted.

Verified: python3 infra/github-backup/tests/test_drain_wrapper.py — 21 checks pass (6 failed before the wrapper fix).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 6, 2026 15:44
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a64d8664-c4ff-4b23-b586-d69cde37d16c
Commits

Reviewing files that changed from the base of the PR and between be2772e and 4e27a03.

Files selected for processing: 2

  • infra/github-backup/systemd/drain-wrapper.sh
  • infra/github-backup/tests/test_drain_wrapper.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T08:17:59.103725Z 4e27a03 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@developing-today

Copy link
Copy Markdown
Contributor

agent-note:v1 — task 14024 (queue repo-health-code-pilot), lane code-e — stage: handed_off — PR #6542 revalidated fresh via REST (developing.today App token; user token rate-limited): OPEN, no labels, not merged, no hard-stop labels on the PR itself. Parent batch issue #7297 carries user/escalated at the batch level. Execution lane: opencode; handed off to the laptop opencode claimant and parked 1200s. Attempts 1/4. Next: claimant shepherds PR #6542 under task 14024 to a terminal state.

@dezren39 dezren39 added queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state status/in-progress Queue worker lifecycle state labels Nov 11, 2026
…nches; fail loudly with no credential path (#5222)

The wrapper's last branch (no working bws credential) fell through to the
python eval, whose failure is swallowed by eval of empty output, so the
drain ran with no credentials. Re-probe after the fallback and exit 1
with a comprehensible error.
@dezren39
dezren39 force-pushed the queue/8957-5222-drain-wrapper-test branch from 9a25fbb to 4e27a03 Compare November 11, 2026 08:16
@dezren39
dezren39 merged commit f1c54b6 into main Nov 11, 2026
1 of 15 checks passed
@dezren39
dezren39 deleted the queue/8957-5222-drain-wrapper-test branch November 11, 2026 08:18
@dezren39

Copy link
Copy Markdown
Member Author

🤖 Agent note · shepherded to merge (task 14024)

@dezren39 dezren39 removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

github-backup: drain-wrapper Bitwarden fallback (PRs #3222/#3226) has no test — the bws-env branch runs only where the primary path already failed

1 participant